<form>
  <div class="view-title">Update client info</div>
  <input id="edit-client-id" type="hidden" />
  <div class="input-div"><label >full name:</label><input name="name" id="edit-client-name" type="text" /></div>
  <div class="input-div"><label >birthday:</label><span id="edit-client-bday" ></span></div>
  <div class="input-div"><label >address:</label><input name="address" id="edit-client-address" type="text" /></div>
  <div class="input-div"><label >cellphone:</label><input name="cellPhone" id="edit-client-cellPhone" type="text" /></div>
  <div class="input-div"><label >email:</label><input name="eMail" id="edit-client-eMail" type="text" /></div>
  <input id="edit-client-button" type="button" value="Update Client"/>
</form>
<script>
  $('#edit-client-button').click(function(){
    mesg.clear();
    client.edit($('#edit-client-id').val(), $('#edit-client-form').serialize(), function(data){
      if(data.success == 'true'){
        mesg.notice("Successfully edited");
        client.view(function(data){
          $('#client-div').html(data);
        });
      }else{
        mesg.error(data.response.errors.toString());
      }
    });
  });
  
  $('#edit-client-bday').birthdaypicker({
    dateFormat: 'bigEndian'
  });
</script>